1. Field of the Invention
The present invention relates in general to an apparatus and a method to perform logarithmic computations, and more particularly to the precise computation of a logarithm to a base p of a floating-point number.
2. Description of the Related Art
The representation of floating-point numbers is similar to commonly used scientific notation and consists of two parts, the mantissa M and the exponent. The floating-point number F represented by the pair (M, E) has the value,F=M×βE
Where β is the base of the exponent.
In an effort to unify methods employed in computer systems for performing binary floating-point arithmetic, the IEEE in the early 1980s standardized computer floating-point numbers. Such binary floating-point numbers make possible the manipulation of large as well as small numbers with great precision, and thus are often used in scientific calculations. They typically comprise either single precision format or double precision format, with single precision operating on 32-bit operands and double precision operating on 64-bit operands. Both single and double precision numbers constitute a bit-string characterized by three fields: a single sign bit, several exponent bits, and several fraction or mantissa bits, with the sign bit being the most significant bit, the exponent bits being the next most significant, and the mantissa bits being the least significant.
FIG. 1 is a diagram showing the form of the single format. Hence, base 2 was selected, a flowing point number F in the single format has the form:F=(−1)S·2E−127·(1.f)
where S=sign bit;
E=8-bit exponent biased by 127;
f=F's 23-bit fraction or mantissa which, together an implicit leading 1, yield the significant digit field “1. - - - ”.
Presently, the calculation for the floating-point is used for all kinds of calculations. Computing efficiency depends on efficiency of the calculation of the floating-point. For logarithmic computation of a floating-point number, a logarithmic table is usually determined in advance. Then, the result is found by checking the table. However, when using the logarithmic table, there is a problem of precision. An 8-bit logarithmic table is quite large, but if an 8-bit logarithmic table is used for logarithmic computation of a flouting-point number, the precision of the computing result is not enough. Because the mantissa part of the flouting-point number has 23 bits, to precisely compute a logarithmic of a floating-point number, it is not enough to check an 8-bit logarithmic table.